package com.lijiajia.cloud.authserver.pojo.mongodb;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * 权限
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@Document(collection = "authority")
public class Authority {
    @Id
    @JsonIgnore
    private ObjectId mongodbId;

    /**
     * 权限id
     */
    private String id;

    /**
     * 名称
     */
    private String name;

    /**
     * 描述
     */
    private String description;

    /**
     * 启用
     */
    private Boolean enabled;

    /**
     * 创建时间
     */
    @CreatedDate
    private LocalDateTime createdAt;
    public static final String CREATED_AT = "created_at";
    /**
     * 最后修改时间
     */
    @LastModifiedDate
    private LocalDateTime lastModifiedAt;
    public static final String LAST_MODIFIED_AT = "last_modified_at";

}
